/**
 * Created by luojie on 2018/3/13.
 */

export default class LoginInput extends React.PureComponent{
	constructor(props){
		super(props);
		this.onChange = this.onChange.bind(this);
		this.onFocus = this.onFocus.bind(this);
	}
	static defaultProps = {
		leftText:"家长姓名",
		placeholder:"请输入家长姓名"
	};
	componentDidMount(){

	}
	onChange(e){
		let {onChange} = this.props;
		onChange && onChange(e.target.value);
	}
	onFocus(){
		$('body,html').height(document.body.clientHeight);
	}

	render(){
		let {leftText,placeholder,type,maxLength} = this.props;
		return(
			<div className="login-input-row">
				<span className="input-label" >{leftText}</span>
				<form action="javascript:void(0);">
					<input
						type={type || "text"}
						placeholder={placeholder}
						onFocus={this.onFocus}
						maxLength = {maxLength}
						onChange = {this.onChange}
						className="login-input"/>
				</form>

			</div>
		)
	}
}